#!/usr/bin/env python
# -*- coding:utf-8 -*-

# info = {"name":"刘伟","age":18,"性别":"男","爱好":"同桌"}
# # for v1 in info.keys():
# #     print(v1)
# #
# # for v2 in info.values():
# #     print(v2)
#
# for v1,v2 in info.items():
#     print(v1,v2)
# user = {"user":"mody","password":"123456"}
# u = input("请输入用户名：")
# p = input("请输入密码：")
# if user["user"]==u and user["password"]==p:
#     print("登录成功！")
# else:
#     print("用户名或密码错误")

# valu = "k1|v1,k2|v2,k3|v3"
# di = {}
# ls = valu.split(",")
# print(ls)
# for i in ls:
#     k,v = i.split("|")
#     di[k] = v
# print(di)

# while True:
#     n = input("请输入用户名：")
#     if n == "N":
#         break
#     p = input("请输入密码：")
#     d = {}
#     d[n] = p
#     ls = []
#     ls.append(d)
#     u1 = input("请输入正确的用户名：")
#     p1 = input("请输入正确的密码：")
#     if u1 == n and p == p1:
#         print("登录成功！")D:\\Python\\learn\\learnPython
# print("结束！")

info = [{"usr":"alex","pwd":"123"},{"usr":"monica","pwd":"321"},{"usr":"dania","pwd":"456"}]
u = input("请输入登录用户名：")
p = input("请输入用户密码：")
message = "用户名或密码错误"
for item in info:
    if item["usr"]==u and item["pwd"]==p:
        message = "登录成功"
print(message)

